package com.xmutca.cloud.auth.security;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 用户持久化的session信息
 * @author: weihuang.peng
 * @version Revision: 0.0.1
 * @Date: 18 Feb,2017
 */
public class SecurityPrincipal extends User {

	private static final long serialVersionUID = 7050711519566670872L;

	private String uuid;
	
	private String salt;
	
	public SecurityPrincipal(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, String uuid, String salt) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
		this.uuid = uuid;
		this.salt = salt;
	}

	public SecurityPrincipal(String username, String password, Collection<? extends GrantedAuthority> authorities, String uuid, String salt) {
		super(username, password, authorities);
		this.uuid = uuid;
		this.salt = salt;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}
}
